home *** CD-ROM | disk | FTP | other *** search
- #ifndef __STDPREFS__
- #define __STDPREFS__
-
- /* File StdPrefs.h
- Standard preferences file handling routines, interface.
- System 6 or better requires HFS
- Copyright (c) 1996, 1997 by John Montbriand. All Rights Reserved.
- Permission hereby granted for public use.
- Distribute freely in areas where the laws of copyright apply.
- USE AT YOUR OWN RISK.
- DO NOT DISTRIBUTE MODIFIED COPIES.
- Comments/questions/postcards* to the author at the address:
- John Montbriand
- P.O. Box. 1133
- Saskatoon Saskatchewan Canada
- S7K 3N2
- or by email at:
- tinyjohn@sk.sympatico.ca
- *if you mail a postcard, then I will provide you with technical support
- regarding questions you may have about this file.
- see also: <http://www3.sk.sympatico.ca/tinyjohn>
- */
-
- #include <Types.h>
- #include <Files.h>
-
- /* FindPreferencesFolder finds the preferences folder
- returning its volume reference number and directory id. */
- OSErr FindPreferencesFolder(short *pvol, long *pdir);
-
- /* PrefsDirSearch searches the preferences folder for a file
- with the given creator and type. If such a file exists, then
- fvol, fdir, and fname are set to refer to the file. */
- OSErr PrefsDirSearch(OSType creator, OSType type,
- short *fvol, long *fdir, StringPtr fname);
-
- /* FSpPrefsDirSearch is identical to PrefsDirSearch except it returns
- information about the file's location in a file specification record. */
- OSErr FSpPrefsDirSearch(OSType creator, OSType type, FSSpec *spec);
-
- /* PrefsCreate creates a file in the prefs folder with the given creator
- type and defaultname. If a file already exists with the name defaultname,
- then a digit (1 2 3...) is appended to defaultname until a unique name
- is found. This routine creates a resource fork for the file too. Once
- the file has been successfully created, fvol, fdir, and fname are set
- to refer to the file. */
- OSErr PrefsCreate(OSType creator, OSType type, StringPtr defaultname,
- short *fvol, long *fdir, StringPtr fname);
-
- /* FSpPrefsCreate is identical to PrefsCreate except it returns
- information about the created file's location in a file specification record. */
- OSErr FSpPrefsCreate(OSType creator, OSType type, StringPtr defaultname,
- FSSpec *spec);
-
- #endif
-